package com.semanticweb.rbac.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.ManyToMany;
import javax.validation.constraints.NotNull;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.activerecord.RooJpaActiveRecord;
import org.springframework.roo.addon.json.RooJson;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooJson
@RooJpaActiveRecord(finders = { "findUsersesByUsernameEquals", "findUsersesByRoles", "findUsersesByUsernameEqualsAndPasswordEquals" })
public class Users {

    @NotNull
    private String username;

    @ManyToMany(cascade = CascadeType.ALL)
    private Set<Roles> roles = new HashSet<Roles>();

    @NotNull
    private String password;

    @NotNull
    private String firstName;

    @NotNull
    private String lastName;

    @NotNull
    private Boolean isLocked;

}
